// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

export enum selfType{
    normalBar = 0,
    stabBar = 1
}

@ccclass
export default class selfAction extends cc.Component {

    @property({type : cc.Enum(selfType),displayName : "自身类型"})
    curType : selfType = selfType.stabBar;

    rotateSpeed = 300;

    update (dt) {
        if(this.curType == selfType.stabBar){
            this.node.getComponent(cc.RigidBody).angularVelocity = this.rotateSpeed;
        }
    }
}
